<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>

<atleap:constants className="com.blandware.atleap.common.Constants" var="ADMIN_CSS_THEME"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!-- I do not integrate this page as a tile, but rather as a standalone-page -->
<html>
	<head>
		<!-- HTTP 1.1 -->
		<meta http-equiv="Cache-Control" content="no-store"/>
		<!-- HTTP 1.0 -->
		<meta http-equiv="Pragma" content="no-cache"/>
		<!-- Prevents caching at the Proxy Server -->
		<meta http-equiv="Expires" content="0"/>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title>
			<atleap:message key="core.mailTemplate.previewMessage" />
		</title>
		<link rel="stylesheet" type="text/css" media="all" href="<atleap:rewriteUrl href="/styles/theme/${appConfig[ADMIN_CSS_THEME]}/theme.css"/>" />
		<script language="javascript" src="<atleap:rewriteUrl href="/scripts/core/klayers.js"  />">
		</script>        
		<script language="javascript" src="<atleap:rewriteUrl href="/scripts/core/global.jsp"  />">
		</script>
	</head>

	<body>
		<table cellpadding="0" cellspacing="0" border="0" class="tableView">
			<tr>
				<th><atleap:message key="core.mailTemplate.form.from" /></th>
				<td>
					${requestScope.from}
				</td>
			</tr>
			<tr>
				<th>
					<atleap:message key="core.mailTemplate.form.subject" />
				</th>
				<td>
					${requestScope.subject}
				</td>
			</tr>
			<tr>
				<th colspan="2" style="text-align: center;">
					<atleap:message key="core.mailTemplate.form.body" />
				</th>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<c:set var="loadMethod" value="javascript" />
					<c:if test="${empty requestScope.templateIsPlain}">
						<c:set var="loadMethod" value="servlet" />
					</c:if>
					<atleap:iframe loadMethod="${loadMethod}" width="95%">
						${requestScope.body}
					</atleap:iframe>
				</td>
			</tr>
		</table>
	</body>
</html>
